package com.gugee.tiktok.data.consumer.keyword.config;

import com.gugee.tiktok.data.common.config.KafkaProducerCommon;
import com.gugee.tiktok.data.common.msg.KeywordMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.EnableKafka;
import org.springframework.kafka.core.KafkaTemplate;


/**
 *
 * @author luolifeng
 * Date  2020/10/27
 */
@Configuration
@EnableKafka
public class KafkaProducerKeywordConfig {
    @Autowired
    KafkaProducerCommon kafkaProducerCommon;
    @Bean
    public KafkaTemplate<Long, KeywordMessage> kafkaTemplateKeyword() {
        return new KafkaTemplate<>(kafkaProducerCommon.myKafkaProducerFactory(KeywordMessage.MsgSerializer.class));
    }
}
